package javacode.chapter04;

import java.util.Scanner;

public class Example4_3 {
    public static void main(String[] args) {
        //判断一个正整数是奇数还是偶数
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个正整数：");
        int x = scanner.nextInt();

        if (x % 2 == 0) {
            System.out.println(x + "是偶数！");
        } else {
            System.out.println(x + "是奇数！");
        }
    }
}
